home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Mac OS Development Toolkit / Automation Essentials 2.3.0 / Host Automation Folder / VU External Tool libs / Results Express.lib < prev    next >
Encoding:
Text File  |  1998-03-19  |  20.7 KB  |  683 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        Results Express.lib
  5. #
  6. #    Contains:    xxx put contents here xxx
  7. #
  8. #    Written by:    PUT NAMES OF ALL SOFTWARE AUTHORS HERE
  9. #
  10. #    Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #        1.1.0    02/12/97    JAS        Added 'vers' resources to library.
  19. #                                    These should always match tool version when tool is revved.
  20. #        <12>     11/8/95    ML        NewMatrix - declared kNewMatrixID as global
  21. #
  22. # ****************************************************************************
  23. #
  24.  
  25. #
  26. #    File:        Results Express.lib
  27. #
  28. #    Contains:    Virtual User task library for calling Results Express
  29. #
  30. #    Written by:    RV
  31. #
  32. #    Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  33. #
  34. #    Change History (most recent first):
  35. #
  36. #                 7/19/94    RV        xxx put comment here xxx
  37. #
  38. #    To Do:
  39. #
  40.  
  41. Libraries "Results Express.vutool";
  42.  
  43. #######################################################################################
  44. #    InitResultsExpress
  45. #
  46. #    Prepares Results Express as an external tool.
  47. #    This task must be called before any other task from this library
  48. #
  49. # Input:
  50. #
  51. #    OnTarget
  52. #        Pass in true if Results Express is to run on a target, false for the Host.
  53. #        By default Memory Monitor runs on the Host
  54. #    
  55. #######################################################################################
  56. Task    InitResultsExpress( OnTarget := false )
  57. Begin
  58.     global    kREMatrixKind        := 1;
  59.     global    kRESuiteKind        := 2;
  60.     global    kRETargetKind        := 3;
  61.     global    kRETestCaseKind        := 4;
  62.     global    kRETestSpecKind        := 5;
  63.     global    kRESysFileKind        := 6;
  64.  
  65.     global    kREDefaultMatrixID    :=  0;
  66.     global    kREInvalidID        := -1;
  67.     global    kNewMatrixID        := -2;
  68.  
  69.     x := ResultsExpress( "Initialize", OnTarget ); # Launch Results Express on the Host
  70.     SErr := ScriptError();
  71.     x := x + { SErr };
  72.     ReportError( "InitResultsExpress", x );
  73.     return x;
  74. end; 
  75.  
  76. #######################################################################################
  77. #    QuitResultsExpress()
  78. #
  79. #    Causes Results Express application to 'Quit'.
  80. #
  81. #######################################################################################
  82. Task QuitResultsExpress()
  83. Begin
  84.     x := ResultsExpress( "Quit" );
  85.     SErr := ScriptError();
  86.     x := x + { SErr };
  87.     ReportError( "QuitResultsExpress", x );
  88.     return x;
  89. end;
  90.  
  91. #######################################################################################
  92. #    NewMatrix(    pFields := {},
  93. #                pCallAsync := false )
  94. #
  95. #    Creates a new Matrix record with a unique ID. Adds the data contained in pFields
  96. #    to the new record and returns the unique ID.
  97. #
  98. # Input:
  99. #
  100. #    pFields        list
  101. #        A list of data to be stored in the record. pFields is a list of
  102. #        label and value pairs. i.e.    { { label1, value1 },{ label2, value2 }, ... }
  103. #        Example: pFields = {     { "MatrixName", "QuickLooks Matrix" }, 
  104. #                                { "StartDate", "10:23:45 AM" }, ... }
  105. #
  106. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  107. #
  108. #######################################################################################
  109. Task    NewMatrix(    pFields := {},
  110.                     pCallAsync := false )
  111. Begin
  112.     x := NewRecord( global kREMatrixKind,  
  113.                     global kNewMatrixID,  
  114.                     pFields,
  115.                     pCallAsync );
  116.     ReportError( "NewMatrix", x );
  117.     return x;
  118. end; 
  119.  
  120. #######################################################################################
  121. #    AddMatrixFields(    pMatrixID := global kREDefaultMatrixID, 
  122. #                        pFields := {}, 
  123. #                        pCallAsync := false )
  124. #
  125. #    Adds data to an existing record, identified by ID
  126. #
  127. # Input:
  128. #
  129. #    pMatrixID    string or integer    The ID of the record to modify
  130. #
  131. #    pFields
  132. #        A list of data to be stored in the record. pFields is a list of
  133. #        label and value pairs.
  134. #        Example: pFields = {     { "MatrixName", "QuickLooks" }, 
  135. #                                { "StartDate", "10:23:45 AM" }, ... }
  136. #
  137. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  138. #
  139. #######################################################################################
  140. Task    AddMatrixFields(    pMatrixID := global kREDefaultMatrixID, 
  141.                             pFields := {}, 
  142.                             pCallAsync := false )
  143. Begin
  144.     x := SetFields( global kREMatrixKind,  
  145.                     pMatrixID,  
  146.                     pFields,
  147.                     pCallAsync );
  148.     ReportError( "AddMatrixFields", x );
  149.     return x;
  150. end; 
  151.  
  152. #######################################################################################
  153. #    NewSuite(    pMatrixID := global kREDefaultMatrixID, 
  154. #                pFields := {}, 
  155. #                pCallAsync := false )
  156. #
  157. #    Creates a new Suite record with a unique ID. Adds the data contained in pFields
  158. #    to the new record and returns the unique ID ( as the 2nd item in return list ).
  159. #
  160. # Input:
  161. #
  162. #    pMatrixID    string or integer    
  163. #        The unique ID of the Matrix to contain this suite record. i.e. specifies the
  164. #        parent record of the newly created record.        
  165. #
  166. #    pFields
  167. #        A list of data to be stored in the record. pFields is a list of
  168. #        label and value pairs.
  169. #        Example: pFields = {     { "SuiteName", "MacWrite QuickLook" }, 
  170. #                                { "StartDate", "10:23:45 AM" }, ... }
  171. #
  172. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  173. #
  174. #######################################################################################
  175. Task    NewSuite(    pMatrixID := global kREDefaultMatrixID, 
  176.                     pFields := {}, 
  177.                     pCallAsync := false )
  178. Begin
  179.     x := NewRecord( global kRESuiteKind,  
  180.                     pMatrixID,  
  181.                     pFields,
  182.                     pCallAsync );
  183.     ReportError( "NewSuite", x );
  184.     return x;
  185. end; 
  186.  
  187. #######################################################################################
  188. #    AddSuiteFields(    pSuiteID, 
  189. #                    pFields := {}, 
  190. #                    pCallAsync := false )
  191. #
  192. #    Adds data to an existing record, identified by ID
  193. #
  194. # Input:
  195. #
  196. #    pSuiteID    string or integer    The ID of the record to modify
  197. #
  198. #    pFields
  199. #        A list of data to be stored in the record. pFields is a list of
  200. #        label and value pairs.
  201. #        Example: pFields = {     { "MatrixName", "QuickLooks" }, 
  202. #                                { "StartDate", "10:23:45 AM" }, ... }
  203. #
  204. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  205. #
  206. #######################################################################################
  207. Task    AddSuiteFields(    pSuiteID, 
  208.                         pFields := {}, 
  209.                         pCallAsync := false )
  210. Begin
  211.     x := SetFields( global kRESuiteKind,  
  212.                     pSuiteID,  
  213.                     pFields,
  214.                     pCallAsync );
  215.     ReportError( "AddSuiteFields", x );
  216.     return x;
  217. end; 
  218.  
  219. #######################################################################################
  220. #    NewTestCase(    pSuiteID, 
  221. #                    pFields := {}, 
  222. #                    pCallAsync := false )
  223. #
  224. #    Creates a new Test Case record with a unique ID. Adds the data contained in pFields
  225. #    to the new record and returns the unique ID ( as the 2nd item in return list ).
  226. #
  227. # Input:
  228. #
  229. #    pSuiteID    string or integer    
  230. #        The unique ID of the Suite to contain this Test Case record. i.e. specifies the
  231. #        parent record of the newly created record.        
  232. #
  233. #    pFields
  234. #        A list of data to be stored in the record. pFields is a list of
  235. #        label and value pairs.
  236. #        Example: pFields = {     { "SuiteName", "MacWrite QuickLook" }, 
  237. #                                { "StartDate", "10:23:45 AM" }, ... }
  238. #
  239. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  240. #
  241. #######################################################################################
  242. Task    NewTestCase(    pSuiteID, 
  243.                         pFields := {}, 
  244.                         pCallAsync := false )
  245. Begin
  246.     x := NewRecord( global kRETestCaseKind,  
  247.                     pSuiteID,  
  248.                     pFields,
  249.                     pCallAsync );
  250.     ReportError( "NewTestCase", x );
  251.     return x;
  252. end; 
  253.  
  254. #######################################################################################
  255. #    AddTestCaseFields(    pTestCaseID, 
  256. #                        pFields := {}, 
  257. #                        pCallAsync := false )
  258. #
  259. #    Adds data to an existing record, identified by ID
  260. #
  261. # Input:
  262. #
  263. #    pTestCaseID    string or integer    The ID of the record to modify
  264. #
  265. #    pFields
  266. #        A list of data to be stored in the record. pFields is a list of
  267. #        label and value pairs.
  268. #        Example: pFields = {     { "MatrixName", "QuickLooks" }, 
  269. #                                { "StartDate", "10:23:45 AM" }, ... }
  270. #
  271. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  272. #
  273. #######################################################################################
  274. Task    AddTestCaseFields(    pTestCaseID, 
  275.                             pFields := {}, 
  276.                             pCallAsync := false )
  277. Begin
  278.     x := SetFields( global kRETestCaseKind,  
  279.                     pTestCaseID,  
  280.                     pFields,
  281.                     pCallAsync );
  282.     ReportError( "AddTestCaseFields", x );
  283.     return x;
  284. end; 
  285.  
  286. #######################################################################################
  287. #    NewTarget(    pMatrixID := global kREDefaultMatrixID, 
  288. #                pFields := {}, 
  289. #                pCallAsync := false )
  290. #
  291. #    Creates a new Target record with a unique ID. Adds the data contained in pFields
  292. #    to the new record and returns the unique ID ( as the 2nd item in return list ).
  293. #
  294. # Input:
  295. #
  296. #    pMatrixID    string or integer    
  297. #        The unique ID of the Matrix to contain this target record. i.e. specifies the
  298. #        parent record of the newly created record.        
  299. #
  300. #    pFields
  301. #        A list of data to be stored in the record. pFields is a list of
  302. #        label and value pairs.
  303. #        Example: pFields = {     { "SuiteName", "MacWrite QuickLook" }, 
  304. #                                { "StartDate", "10:23:45 AM" }, ... }
  305. #
  306. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  307. #
  308. #######################################################################################
  309. Task    NewTarget(    pMatrixID := global kREDefaultMatrixID, 
  310.                     pFields := {}, 
  311.                     pCallAsync := false )
  312. Begin
  313.     x := NewRecord( global kRETargetKind,  
  314.                     pMatrixID,  
  315.                     pFields,
  316.                     pCallAsync );
  317.     ReportError( "NewTarget", x );
  318.     return x;
  319. end; 
  320.  
  321. #######################################################################################
  322. #    AddTargetFields(    pTargetID, 
  323. #                        pFields := {}, 
  324. #                        pCallAsync := false )
  325. #
  326. #    Adds data to an existing record, identified by ID
  327. #
  328. # Input:
  329. #
  330. #    pTargetID    string or integer    The ID of the record to modify
  331. #
  332. #    pFields
  333. #        A list of data to be stored in the record. pFields is a list of
  334. #        label and value pairs.
  335. #        Example: pFields = {     { "MatrixName", "QuickLooks" }, 
  336. #                                { "StartDate", "10:23:45 AM" }, ... }
  337. #
  338. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  339. #
  340. #######################################################################################
  341. Task    AddTargetFields(    pTargetID, 
  342.                             pFields := {}, 
  343.                             pCallAsync := false )
  344. Begin
  345.     x := SetFields( global kRETargetKind,  
  346.                     pTargetID,  
  347.                     pFields,
  348.                     pCallAsync );
  349.     ReportError( "AddTargetFields", x );
  350.     return x;
  351. end; 
  352.  
  353. #######################################################################################
  354. #    NewSystemFile(    pTargetID, 
  355. #                    pFields := {}, 
  356. #                    pCallAsync := false )
  357. #
  358. #    Creates a new System File record with a unique ID. Adds the data contained in pFields
  359. #    to the new record and returns the unique ID ( as the 2nd item in return list ).
  360. #
  361. # Input:
  362. #
  363. #    pTargetID    string or integer    
  364. #        The unique ID of the Target to contain this System File record. i.e. specifies the
  365. #        parent record of the newly created record.        
  366. #
  367. #    pFields
  368. #        A list of data to be stored in the record. pFields is a list of
  369. #        label and value pairs.
  370. #        Example: pFields = {     { "SuiteName", "MacWrite QuickLook" }, 
  371. #                                { "StartDate", "10:23:45 AM" }, ... }
  372. #
  373. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  374. #
  375. #######################################################################################
  376. Task    NewSystemFile(    pTargetID, 
  377.                         pFields := {}, 
  378.                         pCallAsync := false )
  379. Begin
  380.     x := NewRecord( global kRESysFileKind,  
  381.                     pTargetID,  
  382.                     pFields,
  383.                     pCallAsync );
  384.     ReportError( "NewSystemFile", x );
  385.     return x;
  386. end; 
  387.  
  388. #######################################################################################
  389. #    AddSystemFileFields(    pSysFileID, 
  390. #                            pFields := {}, 
  391. #                            pCallAsync := false )
  392. #
  393. #    Adds data to an existing record, identified by ID
  394. #
  395. # Input:
  396. #
  397. #    pSysFileID    string or integer    The ID of the record to modify
  398. #
  399. #    pFields
  400. #        A list of data to be stored in the record. pFields is a list of
  401. #        label and value pairs.
  402. #        Example: pFields = {     { "MatrixName", "QuickLooks" }, 
  403. #                                { "StartDate", "10:23:45 AM" }, ... }
  404. #
  405. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  406. #
  407. #######################################################################################
  408. Task    AddSystemFileFields(    pSysFileID, 
  409.                                 pFields := {}, 
  410.                                 pCallAsync := false )
  411. Begin
  412.     x := SetFields( global kRESysFileKind,  
  413.                     pSysFileID,  
  414.                     pFields,
  415.                     pCallAsync );
  416.     ReportError( "AddSystemFileFields", x );
  417.     return x;
  418. end; 
  419.  
  420. #######################################################################################
  421. #    NewTestSpecification(    pMatrixID := global kREDefaultMatrixID, 
  422. #                            pFields := {}, 
  423. #                            pCallAsync := false )
  424. #
  425. #    Creates a new Test Specification record with a unique ID. Adds the data contained in pFields
  426. #    to the new record and returns the unique ID ( as the 2nd item in return list ).
  427. #
  428. # Input:
  429. #
  430. #    pMatrixID    string or integer    
  431. #        The unique ID of the Matrix to contain this Test Specification record. i.e. specifies the
  432. #        parent record of the newly created record.        
  433. #
  434. #    pFields
  435. #        A list of data to be stored in the record. pFields is a list of
  436. #        label and value pairs.
  437. #        Example: pFields = {     { "SuiteName", "MacWrite QuickLook" }, 
  438. #                                { "StartDate", "10:23:45 AM" }, ... }
  439. #
  440. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  441. #
  442. #######################################################################################
  443. Task    NewTestSpecification(    pMatrixID := global kREDefaultMatrixID, 
  444.                                 pFields := {}, 
  445.                                 pCallAsync := false )
  446. Begin
  447.     x := NewRecord( global kRETestSpecKind,  
  448.                     pMatrixID,  
  449.                     pFields,
  450.                     pCallAsync );
  451.     ReportError( "NewTestSpecification", x );
  452.     return x;
  453. end; 
  454.  
  455. #######################################################################################
  456. #    AddTestSpecificationFields( pTestSpecID, 
  457. #                                pFields := {}, 
  458. #                                pCallAsync := false )
  459. #
  460. #    Adds data to an existing record, identified by ID
  461. #
  462. # Input:
  463. #
  464. #    pTestSpecID    string or integer    The ID of the record to modify
  465. #
  466. #    pFields
  467. #        A list of data to be stored in the record. pFields is a list of
  468. #        label and value pairs.
  469. #        Example: pFields = {     { "MatrixName", "QuickLooks" }, 
  470. #                                { "StartDate", "10:23:45 AM" }, ... }
  471. #
  472. #    pCallAsync    boolean        Determines wheather the tool is called asynchronously
  473. #
  474. #######################################################################################
  475. Task    AddTestSpecificationFields( pTestSpecID, 
  476.                                     pFields := {}, 
  477.                                     pCallAsync := false )
  478. Begin
  479.     x := SetFields( global kRETestSpecKind,  
  480.                     pTestSpecID,  
  481.                     pFields,
  482.                     pCallAsync );
  483.     ReportError( "AddTestSpecificationFields", x );
  484.     return x;
  485. end; 
  486.  
  487. #######################################################################################
  488. #    NewRecord(    pRecordKind, 
  489. #                pParentID, 
  490. #                pFields, 
  491. #                pCallAsync := false )
  492. #
  493. #    This task calls Results Express to create a new record, containing
  494. #    the specified field data, within the specified parent record.
  495. #
  496. # Input:
  497. #
  498. #    pRecordKind    - integer    code indicating the type of record
  499. #    pParentID    - integer    integer code specifying the Parent of the new record
  500. #    pFields        - list        list list of label value pairs (a list of lists)
  501. #    pCallAsync    - boolean    make call to R.E. asynchronously if true
  502. #
  503. # Output:
  504. #    returns            - list        { ErrCode, Result, ErrMsg, ScriptErr }
  505. #        item 1        - integer    ErrCode:  zero for no errors
  506. #        item 2        - any         Result: the ID of the newly created record
  507. #        item 3        - integer    ErrMsg: error message
  508. #        item 4        - integer    ScriptErr: the script error just after R.E. tool call
  509. #
  510. # Example:    
  511. #    tMatrixID := NewMatrix( tFields );
  512. #    tFields := { {"SuiteName", "Example Suite" } };
  513. #    SetFields(    kRESuiteKind, tSuiteID, tFields );
  514. #
  515. # Assumptions:    The Suite record must already exist and the ID must
  516. #                originally come from the NewRecord call which created it.
  517. #######################################################################################
  518. Task    NewRecord(    pRecordKind, 
  519.                     pParentID, 
  520.                     pFields, 
  521.                     pCallAsync := false )
  522. Begin
  523.  
  524.     x := ResultsExpress(     "NewRecord",  
  525.                             pRecordKind,  
  526.                             pParentID,  
  527.                             pFields ) Async:pCallAsync;
  528.     
  529.     SErr := ScriptError();
  530.     x := x + { SErr };
  531.     return x;
  532. end; 
  533.  
  534. #######################################################################################
  535. #    SetFields(    pRecordKind, 
  536. #                pRecordID, 
  537. #                pFields, 
  538. #                pCallAsync := false )
  539. #
  540. #    This task calls Results Express to append fields to an 
  541. #    existing record. A field in the record which already 
  542. #    contains a value will be over written.
  543. #
  544. # Input:
  545. #
  546. #    pRecordKind    - integer    code indicating the type of record
  547. #    pRecordID    - integer    integer code specifying which record
  548. #    pFields        - list        list list of label value pairs (a list of lists)
  549. #    pCallAsync    - boolean    make call to R.E. asynchronously if true
  550. #
  551. # Output:
  552. #    returns            - list        { ErrCode, Result, ErrMsg, ScriptErr }
  553. #        item 1        - integer    ErrCode:  zero for no errors
  554. #        item 2        - any         Result: the ID of the record operated upon 
  555. #        item 3        - integer    ErrMsg: error message
  556. #        item 4        - integer    ScriptErr: the script error just after R.E. tool call
  557. #
  558. # Example:    
  559. #    tSuiteID := NewSuite( kRESuiteKind, gMatrixID, tFields );
  560. #    tFields := { {"SuiteVal", 1 } };
  561. #    SetFields(    kRESuiteKind, tSuiteID, tFields );
  562. #
  563. # Assumptions:    The Suite record must already exist and the ID must
  564. #                originally come from the NewRecord call which created it.
  565. #######################################################################################
  566. Task    SetFields(    pRecordKind, 
  567.                     pRecordID, 
  568.                     pFields, 
  569.                     pCallAsync := false )
  570. Begin
  571.     x := ResultsExpress(     "SetFields",  
  572.                             pRecordKind,  
  573.                             pRecordID,  
  574.                             pFields ) Async:pCallAsync;
  575.     SErr := ScriptError();
  576.     x := x + { SErr };
  577.     return x;
  578. end; 
  579.  
  580. #######################################################################################
  581. #    Consolidate(    pMatrixID := 0, 
  582. #                    pMatrixName := '', 
  583. #                    pPutInDropFolder := false,
  584. #                    pPreserveRawData := true, 
  585. #                    pCallAsync := false )
  586. #
  587. #    Creates a Phoenix import file from the existing data within a Matrix.
  588. #    If no Matrix ID is provided, the default Matrix (ID of zero) is Consolidated.
  589. #    The Phoenix import file is created within the Matrix folder named with the 
  590. #    Matrix ID, in the Matrices folder, adjacent to the Results Express application.
  591. #
  592. # Input:
  593. #
  594. #    pMatrixID            - string or integer    
  595. #                            The ID of the matrix to generate import file from
  596. #
  597. #    pMatrixName            - string
  598. #                            Name to be given to the Matrix
  599. #
  600. #    pPutInDropFolder    - Boolean (symbol true | false )    
  601. #                            If true, generated Import file is put into
  602. #                            the current R.E. Drop Folder
  603. #
  604. #    pCallAsync    - boolean    make call to R.E. asynchronously if true
  605. #
  606. #######################################################################################
  607. Task    Consolidate(    pMatrixID := 0, 
  608.                         pMatrixName := '', 
  609.                         pPutInDropFolder := false,
  610.                         pPreserveRawData := true, 
  611.                         pCallAsync := false )
  612. Begin
  613.     x := ResultsExpress(     "Consolidate", 
  614.                             pMatrixID , 
  615.                             pMatrixName, 
  616.                             pPutInDropFolder, 
  617.                             pPreserveRawData ) Async:pCallAsync;
  618.     SErr := ScriptError();
  619.     x := x + { SErr };
  620.     ReportError( "Consolidate", x );
  621.     return x;
  622. end; 
  623.  
  624. #######################################################################################
  625. #    ReportError( pTaskName, pResult )
  626. #
  627. #    Print error message to Notebook if pResult indicates an error
  628. #
  629. # Input:
  630. #
  631. #    pOperationName        - string 
  632. #                            The name of the operation which encountered an error
  633. #
  634. #    pResult                - list
  635. #                            Results Express return value to check for errors
  636. #
  637. # Output:
  638. #    Returns:    nothing
  639. #    Notebook recieves Println statments.
  640. #######################################################################################
  641. Task    ReportError( pOperationName, pResult )
  642. Begin
  643.     if ( (pResult[1] <> 0) or (pResult[4] <> 0) )
  644.     begin
  645.         Println "# Error during ", pOperationName;
  646.         Println "# Error Code   = ", pResult[1];
  647.         Println "# Return Value = ", pResult[2];
  648.         Println "# Error Msg    = ", pResult[3];
  649.         Println "# Script Err   = ", pResult[4];
  650.     end;
  651. end; 
  652.  
  653. #######################################################################################
  654. #    EqualREIDs( pID1, pID2 )
  655. #
  656. #    Compares the IDs and returns true if they are the same
  657. #    otherwise it returns false.
  658. #    This task is needed since IDs can be of two types, integer or string.
  659. #    A straight if( id1 = id2 ) ... will not work
  660. #
  661. # Input:
  662. #
  663. #    pID1 and pID2    string or integer    The IDs to be compared
  664. #
  665. #######################################################################################
  666. Task    EqualREIDs( pID1, pID2 )
  667. Begin
  668.         ###    Convert both IDs to string values if needed
  669.     if( TypeOf( pID1 ) = 'integer' )
  670.     begin
  671.         pID1 := numtostr( pID1 );
  672.     end;
  673.     
  674.     if( TypeOf( pID2 ) = 'integer' )
  675.     begin
  676.         pID2 := numtostr( pID2 );
  677.     end;
  678.  
  679.         ###    Now compare the values
  680.     return pID1 = pID2;
  681. end; 
  682.  
  683.